<template>
	<view class="indexPage">
		<!-- 轮播图 -->
		<view class="banner">
			<swiper indicator-dots indicator-color="#999" indicator-active-color="#555555" autoplay class="swiper" circular>
				<swiper-item v-for="item in 4" class="swiperItem">
					<image src="/common/images/u=1060958711,1200859302&fm=253&fmt=auto&app=138&f=JPEG.webp" class="img"></image>
				</swiper-item>
			</swiper>
		</view>
		
		<!-- 公告 -->
		<view class="notice" >
			<view class="left">
				<uni-icons type="sound" size="20" color="#1fb68b"></uni-icons>
				<view class="text">公告</view>
			</view>
			<view class="middle">
				<swiper autoplay vertical interval="1500" duration="300" circular>
					<swiper-item v-for="item in 2" >
						哈喽，欢迎来到约个球小程序，请多多支持！
					</swiper-item>
				</swiper>
			</view>
			<view class="right">
				<uni-icons type="right" size="15" color="#888"></uni-icons>
			</view>
		</view>
		
		<!-- 分类 -->
		<view class="ball">
			<view class="box" @click="toCatalogDetail">
				<view class="img">
					<image src="../../static/球类图标/篮球.jpg" mode="aspectFill"></image>
				</view>
				<view class="text">
					篮球
				</view>
			</view>
			<view class="box" >
				<view class="img">
					<image src="../../static/球类图标/羽毛球.jpg" mode="aspectFill"></image>
				</view>
				<view class="text">
					羽毛球
				</view>
			</view><view class="box" >
				<view class="img">
					<image src="../../static/球类图标/乒乓球.jpg" mode="aspectFill"></image>
				</view>
				<view class="text">
					乒乓球
				</view>
			</view><view class="box" >
				<view class="img">
					<image src="../../static/球类图标/网球.jpg" mode="aspectFill"></image>
				</view>
				<view class="text">
					网球
				</view>
			</view><view class="box" >
				<view class="img">
					<image src="../../static/球类图标/排球.jpg" mode="aspectFill"></image>
				</view>
				<view class="text">
					排球
				</view>
			</view><view class="box" >
				<view class="img">
					<image src="../../static/球类图标/足球.jpg" mode="aspectFill"></image>
				</view>
				<view class="text">
					足球
				</view>
			</view>
			
		</view>
		
		<!-- 轮播图 -->
		<!-- <view class="banner">
			<swiper indicator-dots indicator-color="#999" indicator-active-color="#555555" autoplay class="swiper" circular>
				<swiper-item v-for="item in 4" class="swiperItem">
					<image src="/common/images/u=1060958711,1200859302&fm=253&fmt=auto&app=138&f=JPEG.webp" class="img"></image>
				</swiper-item>
			</swiper>
		</view> -->
		
		<!-- 预定列表 -->
		<view class="cata">
			<tabItem mode="text"></tabItem>
		</view>
		
	</view>
</template>

<script setup>
	import tabItem from "@/components/tabItem/tabItem.vue"
	
	const toCatalogDetail=()=>{
		uni.navigateTo({
			url:"/pages/catalogDetail/catalogDetail"
		})
	}
</script>

<style lang="scss" scoped>
	.indexPage{
		padding: 0 30rpx;
		/* 添加底部内边距，值等于tabBar的高度 */
		padding-bottom: 90rpx;
		/* 允许内容区域内部滚动 */
		overflow-y: auto;
		.banner{
			.swiper{
				width: 100%;
				height: 400rpx;
				border-radius: 10rpx;
				overflow: hidden;
				.img{
					width: 100%;
					height: 100%;
				}
			}
			
		}
		.ball{
			width: 100%;
			height: 450rpx;
			display: grid;
			grid-template-columns: repeat(3,1fr);
			padding: 20rpx 40rpx;
			grid-row-gap: 20rpx;
			// gap: 80rpx
			grid-column-gap: 50rpx;
			.box{
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				.img{
					width: 100%;
					height: 100%;
					border-radius: 40rpx;
					overflow: hidden;
					image{
						width: 100%;
						height: 100%;
					}
				}
				.text{}
			}
			
		}
		.notice{
			width: 690rpx;
			height: 80rpx;
			line-height: 80rpx;
			border-radius: 80rpx;
			margin: 20rpx auto;
			background-color: #f9f9f9;
			display: flex;
			.left{
				width: 140rpx;
				padding: 10rpx 12rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				.text{
					color: #1fb68b;
					font-size: 28rpx;
					font-weight: 600;
					margin-left: 5rpx;
				}
			}
			.middle{
				flex: 1;
				swiper{
					height: 100%;
					&-item{
						height: 100%;
						font-size: 30rpx;
						color: #666;
						overflow: hidden;
						white-space: nowrap;
						text-overflow: ellipsis;
					}
				}
			}
			.right{
				width: 70rpx;
				display: flex;
				align-items: center;
				justify-content: center;
			}
		}
		.cata{
			margin-top: 40rpx;
		}
	}
</style>
